import { createApp } from 'vue'
import App from './App.vue'
import router from './router' // 引入路由模块 router
import './service/flexible' // 引入 flexible 模块
import errorHandler from './utils/errorHandler/index' // 引入错误处理模块
import ioPlugin from './plugins/io' // 引入 io 插件模块
import { createPinia } from 'pinia' // 引入 pinia 模块
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import confirm from './utils/confirm'

import './assets/iconfont/iconfont.css'
const pinia = createPinia() // 创建 pinia 实例
pinia.use(piniaPluginPersistedstate)
const app = createApp(App) // 创建 Vue 实例
errorHandler.setupGlobal(app) // 配置全局错误处理
app.use(ioPlugin, {
  connection: 'http://43.138.15.137:3000',
})
app.use(router).use(pinia).use(confirm).mount('#app')
